package com.javafx07;

import javafx.application.Application;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

import java.io.IOException;

public class Main extends Application {

    public static void main(String[] args) {
	    launch(args);
    }

    @Override
    public void start(Stage stage) throws Exception {
        stage.setTitle("图片管理系统");
        Parent root = FXMLLoader.load(getClass().getResource("view/photo.fxml"));
        stage.setScene(new Scene(root));
        stage.show();
    }

    public static void newStageTo(String fxml){
        Stage stage = new Stage();
        stage.setTitle("");
        Parent root = null;
        try {
            root = FXMLLoader.load(Main.class.getResource(fxml));
        } catch (IOException e) {
            e.printStackTrace();
        }
        stage.setScene(new Scene(root));
        stage.show();
    }
}
